<template>
  <div class="main_box" style="padding:10px">
    <div class="detail_wrap">
      <div class="tit">
        <h2>医 检 项 目 组 信 息</h2>
        <el-button
          type="success"
          plain
          size="small"
          icon="fa fa-mail-forward"
          @click="returnList"
        >
          返回</el-button
        >
      </div>
      <div class="con">
        <ul>
          <li>
            <label class="label">项目组编号:</label>
            <span>{{ dataInfo.itemCode }}</span>
          </li>
          <li>
            <label class="label">项目组别称:</label>
            <span>{{ dataInfo.itemShortName }}</span>
          </li>
          <li>
            <label class="label">项目组名称:</label>
            <span>{{ dataInfo.itemName }}</span>
          </li>
          <li>
            <label class="label">医检名称:</label>
            <span>{{ dataInfo.institutionName }}</span>
          </li>
          <li>
            <label class="label">价格模板名称:</label>
            <span>{{ dataInfo.modelName||'暂无' }}</span>
          </li>
          <li>
            <label class="label">对应康来项目组名称:</label>
            <span>{{ dataInfo.reportItemName }}</span>
          </li>
          <li>
            <label class="label">检测日期:</label>
            <span>{{ dataInfo.itemDate }}</span>
          </li>
          <li>
            <label class="label">检测时长:</label>
            <span>{{ dataInfo.itemTime | filterTime }}</span>
          </li>
          <li>
            <label class="label">原价格:</label>
            <span>{{ dataInfo.itemPrice | filterPrice }}</span>
          </li>
          <li>
            <label class="label">合作价格:</label>
            <span>{{ dataInfo.itemSalePrice | filterPrice }}</span>
          </li>
          <li>
            <label class="label">方法学:</label>
            <span>{{ dataInfo.methodology }}</span>
          </li>
          <li>
            <label class="label">临床意义:</label>
            <span>{{ dataInfo.itemMeaning }}</span>
          </li>
          <li>
            <label class="label">注意事项:</label>
            <span>{{ dataInfo.itemNote }}</span>
          </li>
          <li>
            <label class="label">采样耗材是否自供:</label>
            <span>{{ dataInfo.collectSelf | filterCollectSelf }}</span>
          </li>
          <li>
            <label class="label">采样要求:</label>
            <span>{{ dataInfo.collectRequire }}</span>
          </li>
          <li>
            <label class="label">创建人名称:</label>
            <span>{{ dataInfo.createUserName }}</span>
          </li>
          <li>
            <label class="label">创建时间:</label>
            <span>{{ dataInfo.createDate }}</span>
          </li>
        </ul>
      </div>
      <div class="tit">
        <h2>关 联 医 检 子 项 目 列 表</h2>
      </div>
      <el-table
        :data="tableData"
        highlight-current-row
        :header-cell-style="{'background-color':'#f2f2f2'}"
        style="width: min-content;margin: 20px 0;">
        <el-table-column type="index" width="80px" align="center" label="序号">

        </el-table-column>
       <el-table-column prop="subItemId" label="子项目ID" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="subItemCode" label="子项目编号" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="subItemName" label="子项目名称" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="subItemShortName" label="子项目别称" width="180px" align="center">

        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import InstitutionItemApi from "@/api/institution/institutionItem";
export default {
  data() {
    return {
      dataInfo: {},
      tableData: []
    };
  },
  methods: {
    getData() {
      InstitutionItemApi.getInstitutionItem({
        itemId: this.$route.query.id
      }).then(res => {
        this.dataInfo = res.data;
        this.tableData = res.data.institutionItemSubItems
      });
    },
    returnList() {
      this.$store.dispatch("delView", this.$route);
      this.$router.push({ path: "/items/institutionItemManagement" });
      // this.$router.go(-1)
    }
  },
  mounted() {
    this.getData();
  },
  filters: {
    filterCollectSelf(value) {
      // 采样耗材是否自供(0.否 1.是)
      if (value == 0) {
        return "否";
      } else if (value == 1) {
        return "是";
      }
    },
    filterTime(value) {
      if (value) {
        return value + "h";
      } else {
        return "未知";
      }
    },
    filterPrice(value) {
      if (value) {
        return value + "元";
      } else {
        return "未知";
      }
    }
  }
};
</script>
<style lang="scss" src="@/assets/css/views/Detail.scss" scope></style>
